import {
  fetchAllPermission
} from '@/services/system';// 引入API

export default {

  namespace: 'systempermission',

  // 有点类似Vue的data
  state: {
    PermissionList:{
      data:[],
      pagination:{}
    }
  },

  effects: {
    *fetchAll({payload} , {call , put}){
      const response = yield call(fetchAllPermission, payload);
      yield put({
        type:'reducersPermissionList',
        payload: response,
      })
    }
  },

  reducers: {
    reducersPermissionList(state , action){
      return {
        ...state,
        PermissionList:{
          ...action.payload
        }
      }
    }
  }
}
